<#assign entityParam = entity?substring(0,1)?lower_case + entity?substring(1)>
<#assign tableComment = table.comment!?substring(0, table.comment!?length - 1)>
package ${repositoryImplPackage};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${repositoryPackage}.${entity}Repository;
import ${superServiceImplClassPackage};
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;

/**
* ${table.comment!} 数据服务实现类
* @author ${author}
* @since ${date}
*/
@Log4j2
@Service
public class ${entity}RepositoryImpl
        extends ${superServiceImplClass}<${table.mapperName}, ${entity}>
        implements ${entity}Repository {

    /**
    * 新增${tableComment}
    * @param ${entityParam} ${tableComment}参数
    */
    @Override
    public Integer create${entity}(${entity} ${entityParam}) {
        return baseMapper.insert(${entityParam});
    }

    /**
    * 删除${tableComment}
    * @param ${entityParam}Id ${tableComment}ID
    */
    @Override
    public Integer delete${entity}(String ${entityParam}Id) {
        LambdaQueryWrapper<${entity}> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(${entity}::getId, Long.valueOf(${entityParam}Id));
        return baseMapper.delete(queryWrapper);
    }

    /**
    * 更新部分${tableComment}
    * @param ${entityParam} ${tableComment}参数
    */
    @Override
    public Integer update${entity}Partial(${entity} ${entityParam}) {
        return null;
    }

    /**
    * 更新全部${tableComment}
    * @param ${entityParam} ${tableComment}参数
    */
    @Override
    public Integer update${entity}(${entity} ${entityParam}) {
        return baseMapper.updateById(${entityParam});
    }

    /**
    * 查询一条${tableComment}
    * @param ${entityParam}Id ${tableComment}ID
    */
    @Override
    public ${entity} get${entity}ById(String ${entityParam}Id) {
        LambdaQueryWrapper<${entity}> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(${entity}::getId, Long.valueOf(${entityParam}Id));
        return baseMapper.selectOne(queryWrapper);
    }

    /**
    * 分页查询${tableComment}
    * @param ${entityParam} ${tableComment}参数
    * @param page 分页参数-第几页
    * @param size 分页参数-每页行数
    */
    @Override
    public Page<${entity}> get${entity}Page(${entity} ${entityParam}, Long page, Long size) {
        Page<${entity}> ${entityParam}Page = new Page<>(page, size);
        LambdaQueryWrapper<${entity}> queryWrapper = new LambdaQueryWrapper<>();
        return baseMapper.selectPage(${entityParam}Page, queryWrapper);
    }
}
    